package com.sky.controller.user;

import com.sky.dto.UserLoginDTO;
import com.sky.result.Result;
import com.sky.service.UserService;
import com.sky.vo.UserLoginVO;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 目标:
 *
 * @author YUE
 * @date 2024/6/15 16:13
 */
@RestController
@Slf4j
@RequestMapping("/user/user")
@Api(tags = "微信登录接口")
public class UserController {
    @Autowired
    private UserService userService;

    /*
      微信登录
     */
    @PostMapping("/login")
    public Result<UserLoginVO> wxLogin(@RequestBody UserLoginDTO userLoginDTO){
    UserLoginVO userLoginVO =  userService.wxLogin(userLoginDTO);
     return Result.success(userLoginVO);
    }
}
